<html>
<head><meta charset="utf-8"><title>Assumptions about MIR semantics · t-lang/wg-unsafe-code-guidelines · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/index.html">t-lang/wg-unsafe-code-guidelines</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html">Assumptions about MIR semantics</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="168404361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168404361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168404361">(Jun 18 2019 at 14:09)</a>:</h4>
<p><span class="user-group-mention" data-user-group-id="810">@WG-unsafe-code-guidelines</span> what do you think would be a good place to collect assumptions that rustc makes about MIR semantics? And what would that list contain so far?<br>
Looks like <a href="https://github.com/rust-lang/rust/issues/61922" target="_blank" title="https://github.com/rust-lang/rust/issues/61922">#61922</a> will add another item. And then there is <a href="https://github.com/rust-lang/rust/issues/60187" target="_blank" title="https://github.com/rust-lang/rust/issues/60187">#60187</a> which however I think just assumes that after a <code>StorageDead</code>+<code>StorageLive</code>, the address of the local is allowed to differ. (There used to be more assumptions that however were a problem and thus got reverted in <a href="https://github.com/rust-lang/rust/issues/61373" target="_blank" title="https://github.com/rust-lang/rust/issues/61373">#61373</a>).</p>



<a name="168404377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168404377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168404377">(Jun 18 2019 at 14:09)</a>:</h4>
<p>That's an interesting idea</p>



<a name="168404379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168404379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168404379">(Jun 18 2019 at 14:09)</a>:</h4>
<p><span class="user-mention" data-user-id="127859">@Taylor Cramer</span> if you think something is missing from this list, please let us know</p>



<a name="168404436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168404436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168404436">(Jun 18 2019 at 14:10)</a>:</h4>
<p>It seems like to <em>start</em> we could just use an issue</p>



<a name="168405498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168405498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168405498">(Jun 18 2019 at 14:22)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> wasn't somebody interested / working on a MIR model ?</p>



<a name="168405567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168405567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168405567">(Jun 18 2019 at 14:22)</a>:</h4>
<p>probably several people? don't know what you are referring to</p>



<a name="168405962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168405962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168405962">(Jun 18 2019 at 14:26)</a>:</h4>
<p>operational semantics for MIR</p>



<a name="168405970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168405970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168405970">(Jun 18 2019 at 14:26)</a>:</h4>
<p>no I mean what project / which people</p>



<a name="168405985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168405985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168405985">(Jun 18 2019 at 14:27)</a>:</h4>
<p>miri, oli</p>



<a name="168405989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168405989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168405989">(Jun 18 2019 at 14:27)</a>:</h4>
<p>but also I think this is not a 1-step task</p>



<a name="168405993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168405993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168405993">(Jun 18 2019 at 14:27)</a>:</h4>
<p>or a memory model for MIR or similar</p>



<a name="168406008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168406008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168406008">(Jun 18 2019 at 14:27)</a>:</h4>
<p>I have in my head a description of what I think the <em>interface</em> between the MIR semantics and the memory model should look like</p>



<a name="168406029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168406029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168406029">(Jun 18 2019 at 14:27)</a>:</h4>
<p>which is important because it fixes a lot of terminology without fixing all the behavior</p>



<a name="168406063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168406063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168406063">(Jun 18 2019 at 14:28)</a>:</h4>
<p>nono, i was just wondering if something like that was already partially being written somewhere, because maybe that place could also be used to document these things</p>



<a name="168406085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168406085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168406085">(Jun 18 2019 at 14:28)</a>:</h4>
<p>and at some point I'll have the time to write that down</p>



<a name="168406087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168406087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168406087">(Jun 18 2019 at 14:28)</a>:</h4>
<p>not that I know of</p>



<a name="168791983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions%20about%20MIR%20semantics/near/168791983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Assumptions.20about.20MIR.20semantics.html#168791983">(Jun 23 2019 at 12:13)</a>:</h4>
<p>issue created: <a href="https://github.com/rust-lang/unsafe-code-guidelines/issues/150" target="_blank" title="https://github.com/rust-lang/unsafe-code-guidelines/issues/150">https://github.com/rust-lang/unsafe-code-guidelines/issues/150</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>